Pandas builtin visualization

Topics of previous tutorials:

  • Seaborn
  • Plotting 
  • Categorical plotting

Pandas builtin data visualization.

Without importing matplot or seaborn library, we can plot using pandas builtin functions. 

Types of plots that can be plotted by builtin:

  1. DataFrame_name.plot.area ( )
  2. DataFrame_name.plot.bar ( )
  3. DataFrame_name.plot.hist ( )
  4. DataFrame_name.plot.pie ( )
  5. DataFrame_name.plot.line ( )
  6. DataFrame_name.plot.scatter ( )
  7. DataFrame_name.plot.box ( )
  8. DataFrame_name.plot.hexbin ( )
  9. DataFrame_name.plot.kde ( )
  10. DataFrame_name.plot.density ( )

Now let us work on each of the plots

First we have to import the below libraries to work with inbuilt plot of pandas library.

The data frame we will be working with a random defined data

Area plot:

This plot is the total area enclosed under each column. 

This area is in the form of a stack, which means to calculate area of d0 we have to calculate area under plot d0 and remove the area under plot. If we don’t want this way, we have to pass a parameter ‘satcked’ and assign False boolean to it. Here we also can pass a parameter to change the opacity (transparency ) level of the area plot , ‘alpha’ is the parameter which takes values between zero and one. 

Here we also can pass some other parameters that were used in matplot library. 

Bar plot ( ):

We also can use stacked parameter here.

Histogram plot:

Line plot:

This is a plot that we haven’t seen till now. 

This plot appears when no parameter is passed. Let us pass x and y parameter and check the results.

Scatter plot:

Box plot :

Hexbin plot:

Density:

Pie chart:

Topics of the upcoming tutorials in this section are:

Spread knowledge

Leave a Comment

Your email address will not be published. Required fields are marked *